package com.pig4cloud.pig.ai.config;
import com.pig4cloud.pig.ai.utils.AiUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ai初始化配置信息
 */
@Configuration
public class AiConfiguration {

    @Value("${API_KEY}")
    private String API_KEY;
    @Value("${SECRET_KEY}")
    private String SECRET_KEY;
    @Value("${TOKEN_URL}")
    private  String TOKEN_URL;
    @Value("${BAIDU_URL}")
    private  String BAIDU_URL;
    @Value("${ASR_URL}")
    private  String ASR_URL;
    @Value("${TTS_URL}")
    private  String TTS_URL;
    @Value("${FAST_KEY}")
    private  String FAST_KEY;
    @Value("${FAST_APPID}")
    private  String FAST_APPID;
    @Value("${FAST_URL}")
    private String FAST_URL;
    @Bean
    public void initConfiguration() {
        AiUtils.setApiKey(API_KEY);
        AiUtils.setSecretKey(SECRET_KEY);
        AiUtils.setTokenUrl(TOKEN_URL);
        AiUtils.setBaiduUrl(BAIDU_URL);
        AiUtils.setAsrUrl(ASR_URL);
        AiUtils.setTtsUrl(TTS_URL);
        AiUtils.setFastAppid(FAST_APPID);
        AiUtils.setFastKey(FAST_KEY);
        AiUtils.setFastUrl(FAST_URL);
    }
}
